package com.frank.swagger2.web;

import com.frank.swagger2.entity.AnimalVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author 小石潭记
 * @date 2020/10/27 16:29
 * @Description: ${todo}
 */
@RestController
@EnableSwagger2
@Api(value = "SwaggerController", description = "主页")
@RequestMapping("/doc")
public class SwaggerController {

    @GetMapping("/index")
    @ApiOperation(value = "获取接口信息",notes = "获取接口信息",tags = "DataResponseVO",httpMethod = "GET")
    @ApiResponses({//方法返回值的swagger注释
            @ApiResponse(code = 200,message = "成功",response = AnimalVO.class)
    })
    public AnimalVO index(){
        AnimalVO animalVO = new AnimalVO();
        return animalVO.setAge(12).setName("小花");
    }

}
